package com.umeox.ota.data.repository;

import androidx.room.RoomDatabase;
import android.content.Context;

/**
 * 数据管理层接口
 */
public interface IRepositoryManager {

    /**
     * 清理所有缓存
     */
    void clearAllCache();

    /**
     * 获取数据管理对象
     * @param aClass
     * @param <T>
     * @return
     */
     <T> T obtainDataManager(Class<T> aClass);

    /**
     * 获取 Context(Application)
     *
     * @return Context
     */
    Context getContext();

    /**
     *
     * @param database RoomDatabase Class
     * @param <DB>     RoomDatabase
     * @param dbName   RoomDatabase name
     * @return RoomDatabase
     */
    <DB extends RoomDatabase> DB obtainRoomDatabase(Class<DB> database, String dbName);
}
